import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useStore = defineStore('main', () => {
    const someState = ref('你好 pinia')
    const token = ref('')
    const isLogin = ref(false)
    function setToken(val: String) {
        if (val) {
            token.value = val
            isLogin.value = true
        }
    }
    return { someState, isLogin, token, setToken }
},
    {
        persist: true,
    }
)
